﻿@model IEnumerable<Domain.Dto.AutoPushDetailDto>
@{
    var timerService = Presentation.Web.Admin
        .PreAdminEngine.Resolve<Application.Admin.Push.IAutoPushTimerService>();
    var timer = timerService.GetList().Where(e => e.State == true);
    var id = 0;
    if (ViewBag.id != null)
    {
        id = ViewBag.id;
    }
}
<fieldset>
    <legend><a href="/push/autopushtimerindex/">时间段设置</a></legend>
    <input id="autoPushId" name="autoPushId" type="hidden" value="@(id)" />
    @{
        foreach (var item in timer)
        {
            var che = "";
            if (Model.Where(e => e.TimerId == item.Id).Any())
            {
                che = "checked=\"checked\"";
            }
        <input id="timer@(item.Id)" name="timer" @Html.Raw(che)  type="checkbox" value="@(item.Id)"/>
        @(item.BeginHour)@(":")@(item.BeninMinute < 10 ? ("0" + item.BeninMinute.ToString()) : item.BeninMinute.ToString())@("-")@(item.EndHour)@(":")@(item.EndMinute < 10 ? ("0" + item.EndMinute.ToString()) : item.EndMinute.ToString())
        }
    }
</fieldset>
